/**
 * Copyright (c) 2013-Now http://jeesite.com All rights reserved.
 */
package com.jeesite.modules.kj.entity;

import com.jeesite.common.mybatis.annotation.JoinTable;
import com.jeesite.common.utils.excel.annotation.ExcelField;
import com.jeesite.common.utils.excel.annotation.ExcelFields;
import lombok.Data;
import org.hibernate.validator.constraints.Length;

import com.jeesite.common.entity.DataEntity;
import com.jeesite.common.mybatis.annotation.Column;
import com.jeesite.common.mybatis.annotation.Table;
import com.jeesite.common.mybatis.mapper.query.QueryType;
import com.jeesite.common.utils.excel.annotation.ExcelField.Align;

import javax.validation.Valid;

/**
 * kj_questionEntity
 * @author hzy
 * @version 2021-07-19
 */
@Table(name="kj_question", alias="a", columns={
		@Column(name="id", attrName="id", label="id", isPK=true),
		@Column(name="question_type", attrName="questionType", label="问题类型"),
		@Column(name="title", attrName="title", label="问题标题", queryType=QueryType.LIKE),
		@Column(name="content", attrName="content", label="问题内容", isQuery=false),
		@Column(name="reply", attrName="reply", label="反馈内容", isQuery=false),
		@Column(name="reply_status", attrName="replyStatus", label="是否反馈"),
		@Column(name="imgs", attrName="imgs", label="图片", isQuery=false),
		@Column(includeEntity=DataEntity.class),
		@Column(name="member_id", attrName="memberId", label="用户id", isQuery=false),
		@Column(name="member_name", attrName="memberName", label="用户名", queryType=QueryType.LIKE),
		@Column(name="city", attrName="city", label="所处区域名"),
	}, joinTable={
		@JoinTable(type= JoinTable.Type.LEFT_JOIN, entity= KjMember.class, alias="m",
				on="m.id = a.member_id",
				columns={
						@Column(name="id", attrName = "id"),
						@Column(name="name", attrName = "name",queryType = QueryType.LIKE),
						@Column(name="headimg", attrName = "headimg"),
						@Column(name="mobile", attrName = "mobile"),
						@Column(name="member_no", attrName = "memberNo")
				})
}, orderBy="a.update_date DESC"
)
public class KjQuestion extends DataEntity<KjQuestion> {

	private static final long serialVersionUID = 1L;
	public static final String REPLY = "1";
	private String questionType;		// 问题类型
	private String title;		// 问题标题
	private String content;		// 问题内容
	private String reply;		// 反馈内容
	private String replyStatus;		// 是否反馈
	private String imgs;		// 图片
	private String memberId;		// 用户id
	private String memberName;		// 用户名
	private KjMember kjMember;
	private String city;

	private String userCode;

	public KjQuestion() {
		this(null);
	}

	public KjQuestion(String id){
		super(id);
	}


	@Valid
	@ExcelFields({
			@ExcelField(title="姓名", attrName="kjMember.name", align=Align.CENTER, sort=35),
			@ExcelField(title="中兴工号", attrName="kjMember.memberNo", align=Align.CENTER, sort=36),
			@ExcelField(title="电话", attrName="kjMember.mobile", align=Align.CENTER, sort=37),
			@ExcelField(title="所属区域", attrName="city", sort=82, width = 25*256),
			@ExcelField(title="问题标题", attrName="title", align= Align.CENTER, sort=50),
			@ExcelField(title="问题类型", attrName="questionType", dictType = "question_type", align=Align.CENTER, sort=60),
			@ExcelField(title="问题内容", attrName="content", align=Align.CENTER, sort=65),
			@ExcelField(title="是否反馈", attrName="replyStatus", dictType = "sys_yes_no", align=Align.CENTER, sort=75),
			@ExcelField(title="反馈内容", attrName="reply", sort=80, width = 25*256),
	})

	@Length(min=0, max=2, message="问题类型长度不能超过 2 个字符")
	public String getQuestionType() {
		return questionType;
	}

	public void setQuestionType(String questionType) {
		this.questionType = questionType;
	}

	@Length(min=0, max=255, message="问题标题长度不能超过 255 个字符")
	public String getTitle() {
		return title;
	}

	public void setTitle(String title) {
		this.title = title;
	}

	public String getContent() {
		return content;
	}

	public void setContent(String content) {
		this.content = content;
	}

	public String getReply() {
		return reply;
	}

	public void setReply(String reply) {
		this.reply = reply;
	}

	@Length(min=0, max=1, message="是否反馈长度不能超过 1 个字符")
	public String getReplyStatus() {
		return replyStatus;
	}

	public void setReplyStatus(String replyStatus) {
		this.replyStatus = replyStatus;
	}

	public String getImgs() {
		return imgs;
	}

	public void setImgs(String imgs) {
		this.imgs = imgs;
	}

	@Length(min=0, max=64, message="用户id长度不能超过 64 个字符")
	public String getMemberId() {
		return memberId;
	}

	public void setMemberId(String memberId) {
		this.memberId = memberId;
	}

	@Length(min=0, max=255, message="用户名长度不能超过 255 个字符")
	public String getMemberName() {
		return memberName;
	}

	public void setMemberName(String memberName) {
		this.memberName = memberName;
	}



	public KjMember getKjMember() {
		return kjMember;
	}

	public void setKjMember(KjMember kjMember) {
		this.kjMember = kjMember;
	}

	public String getCity() {
		return city;
	}

	public void setCity(String city) {
		this.city = city;
	}

	public String getUserCode() {
		return userCode;
	}

	public void setUserCode(String userCode) {
		this.userCode = userCode;
	}
}
